package oj;

public class Main3 {
    public static int removeDuplicates(int[] nums) {
        int n = nums.length;
        int left = 1;
        for(int right = 1;right < n;right++){
            if(nums[left] != nums[right]){
                left++;
                nums[left] = nums[right];
            }
        }
        return left + 1;
    }
    public static void main(String[] args) {
        int[] nums = {1,1,2};
        System.out.println(removeDuplicates(nums));
    }
}
